/**
 * 
 */
package com.fang.www.join.two.three;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.WritableComparable;

/**
 * @author 王刚
 *
 */
public class User implements WritableComparable<User> {
	private String usrId = "";
	private String usrName = "";
	private String localId = "";
	private String localName ="";
	private int flag;
	public User() {
	}
	public User(User user) {
		this.usrId = user.getUsrId();
		this.usrName = user.getUsrName();
		this.localId = user.getLocalId();
		this.localName = user.getLocalName();
		this.flag = user.getFlag();
	}
	
	public User(String usrId, String usrName, String localId, String localName, int flag) {
		this.usrId = usrId;
		this.usrName = usrName;
		this.localId = localId;
		this.localName = localName;
		this.flag = flag;
	}
	public String getUsrId() {
		return usrId;
	}
	public void setUsrId(String usrId) {
		this.usrId = usrId;
	}
	public String getUsrName() {
		return usrName;
	}
	public void setUsrName(String usrName) {
		this.usrName = usrName;
	}
	public String getLocalId() {
		return localId;
	}
	public void setLocalId(String localId) {
		this.localId = localId;
	}
	public String getLocalName() {
		return localName;
	}
	public void setLocalName(String localName) {
		this.localName = localName;
	}
	public int getFlag() {
		return flag;
	}
	public void setFlag(int flag) {
		this.flag = flag;
	}
	/* (non-Javadoc)
	 * @see org.apache.hadoop.io.Writable#readFields(java.io.DataInput)
	 */
	@Override
	public void readFields(DataInput dataInput) throws IOException {
		// TODO Auto-generated method stub
		this.usrId = dataInput.readUTF();
		this.usrName = dataInput.readUTF();
		this.localId = dataInput.readUTF();
		this.localName = dataInput.readUTF();
		this.flag = dataInput.readInt();
	}
	/* (non-Javadoc)
	 * @see org.apache.hadoop.io.Writable#write(java.io.DataOutput)
	 */
	@Override
	public void write(DataOutput dataOutput) throws IOException {
		// TODO Auto-generated method stub
		dataOutput.writeUTF(usrId);
		dataOutput.writeUTF(usrName);
		dataOutput.writeUTF(localId);
		dataOutput.writeUTF(localName);
		dataOutput.writeInt(flag);
	}
	/* (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	@Override
	public int compareTo(User o) {
		// TODO Auto-generated method stub
		return 0;
	}
	public void init1111(){
		this.flag =0;
		this.localId = "";
		this.localName = "";
		this.usrId = "";
		this.usrName ="";
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return this.usrId+","+this.usrName+","+this.localId+","+this.localName;
	}
	
	
}
